﻿namespace TeachlyQBank.DbPool
{
    public static class DatabaseConnectionFactory
    {
        public static IDatabaseConnection CreateConnection(string databaseType, string connectionString)
        {
            switch (databaseType)
            {
                case "MySQL":
                    return new MySqlConnectionAdapter(connectionString);
                case "SQLServer":
                    return new SqlServerConnectionAdapter(connectionString);
                default:
                    throw new ArgumentException("Invalid database type");
            }
        }
    }
}
